import request from '@/utils/request';

// 查询二级团队人员列表
export function getUserJuniorListApi() {
	return request({
		url: '/system/user/junior/list',
		method: 'get',
	})
}


// 获取奖池列表
export function getPrizeListApi(data) {
	return request({
		'url': '/prize/list/' + data,
		'method': 'get'
	})
}


// 奖池中奖保存
export function saveUserPrizeApi(data) {
	return request({
		url: '/prize/saveUserPrizeRecord',
		method: 'post',
		data: data
	})
}

// 根据用户id查询中奖记录
export function userPrizeRecordListApi(query) {
	return request({
		url: '/prize/userPrizeRecordList/' + query,
		method: 'get',
	})
}

// 奖品使用
export function prizeCashOutApi(data) {
	return request({
		url: '/prize/cash/out',
		method: 'post',
		data: data
	})
}



// 查询用户总积分
export function getTotalPointsApi(query) {
	return request({
		url: '/points/getTotalPoints/' + query,
		method: 'get',
	})
}

// 查询积分变更记录
export function getUserPointsLogApi(query) {
	return request({
		url: '/points/getUserPointsLog/' + query,
		method: 'get',
	})
}

// 签到
export function signInApi(query) {
	return request({
		url: '/sign/in/save/' + query,
		method: 'get',
	})
}

// 签到记录
export function getSigninRecordApi(query) {
	return request({
		url: '/sign/in/getSignInRecord/' + query,
		method: 'get',
	})
}

// 产品记录
export function getProductListApi(data) {
	return request({
		url: '/product/list',
		method: 'post',
		data
	})
}

// 购买产品
export function productPaymentApi(data) {
	return request({
		url: '/purchase/record/payment',
		method: 'post',
		data
	})
}

// 购买产品App支付
export function productPaymentAppApi(data) {
	return request({
		url: '/purchase/record/app/payment',
		method: 'post',
		data
	})
}

// 购买产品h5支付
export function productPaymentH5Api(data) {
	return request({
		url: '/purchase/record/wap/payment',
		method: 'post',
		data
	})
}

// 购买产品记录
export function getOrderListApi(data) {
	return request({
		url: '/purchase/record/user/list',
		method: 'post',
		data
	})
}


// 添加账户
export function addAccount(data) {
	return request({
		url: '/insertUserZfbAccount',
		method: 'post',
		data
	})
}

// 修改账户
export function editAccount(data) {
	return request({
		url: '/updateUserZfbAccount',
		method: 'post',
		data
	})
}

// 查询银行账户
export function selectBankListApi(query) {
	return request({
		url: '/selectUserZfbAccountByUserId/' + query,
		method: 'get',
	})
}

// 积分提现
export function withdrawalApplyApi(data) {
	return request({
		url: '/withdrawal/apply',
		method: 'post',
		data
	})
}

// 查询积分提现记录
export function selectWithdrawalRecordApi(query) {
	return request({
		url: '/withdrawal/selectWithdrawalRecordByUserId/' + query,
		method: 'get',
	})
}

// 查询团队下面的人数
export function getTeamUserNumApi(query) {
	return request({
		url: '/system/user/team/size/' + query,
		method: 'get',
	})
}


// 查询公告列表
export function listNotice(query) {
	return request({
		url: '/system/notice/list',
		method: 'get',
		params: query
	})
}

// 查询公告详细
export function getNotice(noticeId) {
	return request({
		url: '/system/notice/' + noticeId,
		method: 'get'
	})
}

// 用户绑定手机号
export function userBindPhoneApi(data) {
	return request({
		url: '/system/user/bindPhone',
		method: 'post',
		data
	})
}


// 获取手机号
export function getPhoneApi(userId) {
	return request({
		url: '/system/user/getPhone/' + userId,
		method: 'get'
	})
}


// 获取我的推荐
export function getMyRecommendApi(code) {
	return request({
		url: '/system/user/myRecommend/' + code,
		method: 'get'
	})
}


// 获取团队新增
export function getTeamAddApi(id) {
	return request({
		url: '/system/user/team/addition/' + id,
		method: 'get'
	})
}


// 获取默认地址
export function getUserAddressDeApi(id) {
	return request({
		url: '/user/address/default/' + id,
		method: 'get'
	})
}



// 查询地址列表
export function getUserAddressListApi(query) {
	return request({
		url: '/user/address/list/' + query,
		method: 'get',
	})
}


// 添加地址
export function userAddressInsertApi(data) {
	return request({
		url: '/user/address/insert',
		method: 'post',
		data
	})
}

// 修改地址
export function userAddressUpdateApi(data) {
	return request({
		url: '/user/address/update',
		method: 'post',
		data
	})
}


// 用户确认收货
export function userConfirmShopApi(data) {
	return request({
		url: '/purchase/record/confirm/receipt',
		method: 'post',
		data
	})
}


// 套餐订单列表
export function getComboListApi(data) {
	return request({
		url: '/combo/order/user/list',
		method: 'post',
		data
	})
}

// 套餐订单确认收货
export function comboConfirmShopApi(data) {
	return request({
		url: '/combo/order/confirm/receipt',
		method: 'post',
		data
	})
}


// 商城的套餐
export function getComboSelectListApi(data) {
	return request({
		url: '/combo/config/select',
		method: 'post',
		data
	})
}



// 兑换套餐
export function comboOrderExchangeApi(data) {
	return request({
		url: '/combo/order/exchange',
		method: 'post',
		data
	})
}